﻿@model Webdiyer.WebControls.Mvc.IPagedList<HouseAgencySite.Models.HtmlContents>
@{
    ViewBag.Title = "内容管理列表";
    Layout = "~/Areas/Admin/Views/Shared/_ListLayout.cshtml";
}
@using HouseAgencySite.Utils;
@{
    List<SelectListItem> list = HouseAgencySite.Utils.ParamHelper.HtmlContentType(Request["ModuleType"], true);
}
@section query{
    <table class="table table-bordered" style="width:100%;">
        <tr>
            <td>类型</td>
            <td>
                @Html.DropDownList("ModuleType", list, new { @class = "form-control", style = "width:150px" })
            </td>
            <td>标题</td>
            <td>
                @Html.Editor("Keywords",Request["Keywords"])
            </td>
            <td>
                <input type="submit" value="查询" id="btnSearch" class="btn btn-primary" /></td>
        </tr>

    </table>
}
@section toolbar{
    <a href="javascript:void(0);" onclick="Edit('@Url.Action("Create", "HtmlContent", null)',880,750,null)" class="btn btn-primary">新增</a>
}
@section list{
    <table class="table table-bordered">

        <tr class="btn-success">
            <th>序号</th>
            <th>标题
            </th>




            <th>类型
            </th>

            <th>创建时间
            </th>

            <th>创建人
            </th>
            <th>修改时间
            </th>

            <th>修改人
            </th>

            <th>操作</th>
        </tr>

        @{
            int i = 0;
        }
        @foreach (var item in Model)
        {
        
            <tr class="@(i % 2 == 0 ? "success" : "warning")">
               <td>@(i + 1+(Model.CurrentPageIndex-1)*10)</td>
                <td>
                    @Html.DisplayFor(modelItem => item.Title)
                </td>



                <td>
                    @{
                        string moduleType = string.Empty;
                        switch (item.ModuleType)
                        {

                            case 1:
                                moduleType = "关于我们"; break;
                            case 2:
                                moduleType = "贷款担保"; break;
                            case 3:
                                moduleType = "招聘信息"; break;
                            case 4:
                                moduleType = "Banner图"; break;
                            case 5:
                                moduleType = "企业文化"; break;
                            default: break;
                        }
                    }
                    @moduleType
                </td>

                <td>
                    @Html.DisplayFor(modelItem => item.CreateTime)
                </td>

                <td>
                    @Html.DisplayFor(modelItem => item.CreateUserName)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.ModifyTime)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.ModifyUserName)
                </td>
                <td>
                    <a href="javascript:void(0);" onclick="Edit('@Url.Action("Edit", "HtmlContent", new { id = item.Guid })',850,650,null)" class="btn btn-primary btn-xs">编辑</a> |
                    <a href="javascript:void(0);" onclick="openModalPage('@Url.Action("Details", "HtmlContent", new { id = item.Guid })',850,650,null)" class="btn btn-primary btn-xs">查看</a>|
                    <a href="javascript:void(0);" onclick="Delete('@Url.Action("Delete", "HtmlContent", new { id = item.Guid })')" class="btn btn-primary btn-xs">删除</a>
                </td>
            </tr>
            i++;
        }

    </table>
}
<div class="text-center">@Html.HtmlPager(Model)</div>
